#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

int main()
{
	int n = 0;
	scanf("%d", &n);

	if (n < 1)
	{
		printf("-1");
		return 0;
	}

	double sum1 = 0;
	double sum2 = 0;
	double sum3 = 0;

	for (int i = 1; i <= 3 * n; i++)
	{
		sum1 += i;
	}

	for (int i = 1; i <= 2 * n; i++)
	{
		sum2 += pow(i, 2);
	}

	for (int i = 1; i <= n; i++)
	{
		sum3 += 1.0 / i;
	}

	printf("%.1f", sum1 + sum2 + sum3);

	return 0;
} 